//
//  ILGWeakTimer.h
//  ILGDemo
//
//  Created by zhangtongle on 2017/5/11.
//  Copyright © 2017年 Happy. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^ILGWeakTimerBlock)(_Nullable id userInfo);

@interface ILGWeakTimer : NSObject

// 解决了保留环问题，且不需要使用者调用invalidate
+ (NSTimer * _Nullable)scheduledTimerWithTimeInterval:(NSTimeInterval)timeInterval
                                               target:(nonnull id)aTarget
                                             selector:(nonnull SEL)aSelector
                                             userInfo:(nullable id)userInfo
                                              repeats:(BOOL)repeats;

// 解决了保留环问题，且不需要使用者调用invalidate
+ (NSTimer * _Nullable)scheduledTimerWithTimeInterval:(NSTimeInterval)timeInterval
                                               target:(nonnull id)aTarget
                                                block:(_Nonnull ILGWeakTimerBlock)block
                                             userInfo:(nullable id)userInfo
                                              repeats:(BOOL)repeats;
@end
